package com.gopay.common.riskcontrol.identify.dao.impl;

import java.io.Serializable;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.domain.user.identify.RcAcctPayLimit;
import com.gopay.common.riskcontrol.identify.dao.RcAcctPayLimitQueryDAO;

/**
 * RcAcctPayLimitQueryDAO接口实现
 * 
 * RcAcctPayLimitQueryDAOImpl.java
 * @author zhuliang
 * @2016-5-10 上午11:41:01 www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("rcAcctPayLimitQueryDAO")
public class RcAcctPayLimitQueryDAOImpl extends BaseDAOImpl<RcAcctPayLimit, Serializable> implements RcAcctPayLimitQueryDAO{

	@Override
    public RcAcctPayLimit getByAcctType(String acctType){
	    DetachedCriteria criteria = DetachedCriteria.forClass(RcAcctPayLimit.class);
        criteria.add(Restrictions.eq("acctType", acctType));
        
        List<RcAcctPayLimit> list = findByCriteria(criteria);
        
        if(list == null || list.size() == 0){
            return null;
        }else{
            return list.get(0);
        }
	}

}
